home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / vcpimap.zip / VCPIMAP.PAS < prev   
Pascal/Delphi Source File  |  1990-10-22  |  2KB  |  64 lines

  1. program vcpimap;
  2. { uses vcpi to find physical addresses used by QEMM/Desqview }
  3.  
  4. uses
  5.   dos,
  6.   opstring;  { From Object Professional; used only for hex conversions. }
  7.  
  8. const
  9.   vcpi_int = $67;
  10. var
  11.   r : registers;
  12.   rax,rdx : word;
  13.   page : longint;
  14.   physical : longint;
  15.   start,last : longint;
  16. begin
  17.   with r do
  18.   begin
  19.     ax := $de00;
  20.     intr(vcpi_int,r);
  21.     if ah <> 0 then
  22.     begin
  23.       writeln('VCPI not found');
  24.       halt;
  25.     end
  26.     else
  27.       writeln('Running under VCPI version ',bh,'.',bl);
  28.  
  29.     writeln;
  30.     writeln('    V86               Physical');
  31.     writeln('  Segments           addresses');
  32.     write('0000:0 - ');
  33.     for page:=0 to $FFFFF shr 12 do
  34.     begin
  35.       ax := $de06;
  36.       cx := page;
  37.       intr(vcpi_int,r);
  38.       Inline($66/$89/$16/>physical);{      mov [>physical],edx  }
  39.       move(r.dx,physical,2);        {      get the low word too }
  40.       if hi(r.ax) <> 0 then
  41.       begin
  42.         writeln('Error on page ',hexw(page));
  43.         halt;
  44.       end;
  45.       if page = 0 then
  46.         start := physical
  47.       else
  48.       begin
  49.         if physical <> last + 1 shl 12 then
  50.         begin
  51.           writeln(hexw(page shl 8 - 1),':F  ',hexl(start),' - ',
  52.                                               hexl(last + 1 shl 12 - 1));
  53.           write(hexw(page shl 8),':0 - ');
  54.           start := physical;
  55.         end;
  56.       end;
  57.       last := physical;
  58.     end;
  59.     writeln('FFFF:F  ',hexl(start),' - ',hexl(last + 1 shl 12 - 1));
  60.   end;
  61. end.
  62.  
  63.  
  64.